package net.sxnic.workflow.pd.action;

import java.io.File;

import net.sxnic.workflow.node.NodeManager;
import net.sxnic.workflow.pd.utils.PdUtils;
import net.sxnic.workflow.transition.TransitionManager;

import org.springframework.beans.factory.annotation.Autowired;

@SuppressWarnings("serial")
public class Save extends PdAction  {

	private File upload;

	private String uploadFileName;

	@Autowired
	private NodeManager nodeManager;
	
	@Autowired
	private TransitionManager trsManager;

	public String execute() throws Exception {
		try {
			PdUtils.readxml(upload, beanManager, nodeManager,trsManager);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return SUCCESS;
	}

	
	public void prepare() throws Exception {

	}

	public File getUpload() {
		return upload;
	}

	public void setUpload(File upload) {
		this.upload = upload;
	}

	public String getUploadFileName() {
		return uploadFileName;
	}

	public void setUploadFileName(String uploadFileName) {
		this.uploadFileName = uploadFileName;
	}

}
